Skip to content

fix(gate): claude reviewers run the guard check by absolute path so a cd cannot break it (CC-699) - #790

Merged
screenleon merged 2 commits into
mainfrom
fix/gate-guard-check-brief
Nov 6, 2026
Merged

screenleon merged 2 commits into
mainfrom
fix/gate-guard-check-brief

Conversation

@screenleon

@screenleon screenleon commented Nov 6, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Both --executor claude gate runs on 2026-11-06 ended without a verdict: the reviewer must run bash cli/pmctl guard check … before its one write, and the headless session (--permission-prompts none) only allows that one narrow prefix.
  • Reproduced with real claude -p probes (same flags as the adapter): a ; echo rc=$? suffix is denied; a cd is allowed but the shell keeps its directory, so the relative cli/pmctl then exits 127; the absolute path is denied by the old rule.
  • The brief already tells the reviewer not to cd or append anything, and the model did both anyway, so a prompt-only fix is not reliable.
  • Fix: on Windows with the same checkout, the brief now names bash '<checkout>/cli/pmctl' guard check … and adapters/claude/dispatch.sh allows exactly that string (kept the old relative rule; a path with a single quote keeps the relative form).

Verification

  • Also added a case for a checkout path containing a single quote (relative permission only, no absolute rule); the gate run gate-20261106-134815-f1dd68 with --executor claude returned GO on the first attempt.

  • Real claude -p probe with the adapter's allow rule: after cd .gate-briefs, the absolute-path guard check is allowed; the ; echo variant is still denied (unchanged, left to the brief).

  • test-claude-dispatch.sh 43/0, test-pr-gate.sh --filter claude-windows 3/0 (updated expectations and a new allow-rule assertion).

  • No full pr-gate run (this is the gate's own transport); a real claude gate run to confirm end to end is still to do.

  • Permanent test admissions: none (the two new assertions extend existing cases in tests/shell/test-claude-dispatch.sh and tests/shell/test-pr-gate.sh; no new suite)

Not done

  • Allowing echo or other suffixes; having the supervisor run the guard check instead of the model; reviewers' cd … && git diff / git -C reads are still denied (recorded in CC-699).

🤖 Generated with Claude Code

https://claude.ai/code/session_01ESW7P9wHJRbhxx3v7XyQuq

screenleon and others added 2 commits November 6, 2026 21:24
… cd cannot break it (CC-699)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ESW7P9wHJRbhxx3v7XyQuq
… permission (CC-699)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ESW7P9wHJRbhxx3v7XyQuq
@screenleon
screenleon merged commit 482fd7c into main Nov 6, 2026
177 of 178 checks passed
@screenleon
screenleon deleted the fix/gate-guard-check-brief branch November 6, 2026 18:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant